package com.xujl.mvcbind.ui.statusbar.view;

import com.xujl.fastlib.base.BaseView;
import com.xujl.fastlib.base.IControl;
import com.xujl.fastlib.base.LayoutBuilder;
import com.xujl.mvcbind.R;
import com.xujl.mvcbind.databinding.FragmentNormalStatusBarBinding;
import com.xujl.mvcbind.databinding.NormalStatusBarBinding;


/**
 * <pre>
 *     author : xujl
 *     e-mail : 597355068@qq.com
 *     time   : 2019/08/20
 *     desc   :
 *     version: 1.0
 * </pre>
 */

public class NormalStatusBarFragmentView extends BaseView<FragmentNormalStatusBarBinding> {
    private NormalStatusBarBinding mBarBinding;

    @Override
    public LayoutBuilder configLayout () {
        return super.configLayout().setToolbarId(R.layout.normal_status_bar);
    }

    @Override
    public void init (IControl control) {
        mBarBinding = getToolbarBinding();
        mBarBinding.ivBack.setOnClickListener(control);
        mBarBinding.ivMenu.setOnClickListener(control);
    }

    public void changeTitle (String title) {
        mBarBinding.tvTitle.setText(title);
    }

    public void changeBgColor (int bgColor) {
        mBarBinding.toolbarRoot.setBackgroundColor(bgColor);
    }
}
